package day1.service;

import java.util.Date;

import org.junit.Test;

import day1.dao.DaoFactory;
import day1.dao.UserDao;
import day1.domain.User;

public class UserService {
	private UserDao userDao=DaoFactory.getInstance().getUserDao();
	
	@Test
	public void add(){
		User user=new User(0,"nsl",new Date(),5000f,"123");
		userDao.addUser(user);
	}
	
	@Test
	public void get(){
		User user=userDao.getUser(2);
		System.out.println(user);
	}
	
	@Test
	public void findUser(){
		User user=userDao.findUser("nsl","123");
		System.out.println(user);
		User user2=userDao.findUser("nsl","1");
		System.out.println(user2);
		
	}
	
	@Test
	public void delete(){
		User user=new User(2,"nsl",new Date(),5000f,"123");
		userDao.delete(user);
		
	}
	
	
}
